package cn.dmw.service;

import cn.dmw.dto.PassengerPhoneDTO;
import net.sf.json.JSONObject;
import net.sf.json.JSONString;
import org.springframework.stereotype.Service;

@Service
public class VerifiPassengerService {

    public String verifiPassengerInfo(String passengerPhone){
        //1、获取手机号
        System.out.println("获取手机号"+passengerPhone);
        //2、获取验证码
        String code ="yan zheng ma 123";
        System.out.println("获取验证码");
        //3、存放到redis中
        System.out.println("存放到redis中");
        //4、返回json对象
        PassengerPhoneDTO passengerPhoneDTO=new PassengerPhoneDTO();
        passengerPhoneDTO.setPhone(passengerPhone);
        passengerPhoneDTO.setVerifiCode(code);
        System.out.println("test success 实体类： "+passengerPhoneDTO.toString());
        JSONObject result=new JSONObject();
        result.put("code","1");
        result.put("message","success");
        System.out.println("返回json对象");
        return result.toString();
    }
}
